#include "server.h"
//stack最少里面有usr/
char* pathFix(ENTRY* entry,Lstack* stack){
    if(strcmp(entry->data,"..")==0){
        if(stack->size!=1){
            pop(stack);
            
        }else{
            printf("CD Stack error!\n");
            return peek(stack);
        }
    }
    else if(strcmp(entry->data,"~")==0){
        while(stack->size!=1){
            pop(stack);
        }
    }
    else if(strcmp(entry->data,".")==0){

    }
    else{
        char stacktop[4096]={0};
        sprintf(stacktop,"%s/%s",peek(stack),entry->data);
        push(stack,stacktop);
    }
    
    return peek(stack);
}
